# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 125
n 125(None)[]:
	i: 13(), 88(), 112(), 124(AE)
	o: 

nname: 112
n 112(None)[print 'Cannot load wydetect.'
]:
	i: 78(f)
	o: 125()

nname: 88
n 88(None)[#, e
print 'Cannot load wydetect',
print str(e)
]:
	i: 78(t)
	o: 125()

nname: 78
n 78(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 0(except)
	o: 88(t), 112(f)

nname: 13
n 13(None)[name = 'com.wyplay.wydetect'
path = '/com/wyplay/wydetect_status'
burn_clt = bus.reference(name, path)
burn_clt_eject = burn_clt.method('toggle_tray', 's', '')
burn_clt_eject('/dev/cdrom')
]:
	i: 0(try)
	o: 125()

nname: 0
n 0(None)[bus = pygui_globs['wydbus']
]:
	i: 
	o: 13(try), 78(except)

nname: 78
n 78(None)[except Exception, e:
	print 'Cannot load wydetect',
	print str(e)
except:
	print 'Cannot load wydetect.'
]:
	i: 0()
	o: 

nname: 0
n 0(None)[bus = pygui_globs['wydbus']
try:
	name = 'com.wyplay.wydetect'
	path = '/com/wyplay/wydetect_status'
	burn_clt = bus.reference(name, path)
	burn_clt_eject = burn_clt.method('toggle_tray', 's', '')
	burn_clt_eject('/dev/cdrom')
]:
	i: 
	o: 78()

nname: 0
n 0(None)[bus = pygui_globs['wydbus']
try:
	name = 'com.wyplay.wydetect'
	path = '/com/wyplay/wydetect_status'
	burn_clt = bus.reference(name, path)
	burn_clt_eject = burn_clt.method('toggle_tray', 's', '')
	burn_clt_eject('/dev/cdrom')
except Exception, e:
	print 'Cannot load wydetect',
	print str(e)
except:
	print 'Cannot load wydetect.'
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7682a0c>}
nname: 234
n 234(None)[marker_list._refresh()
context['selected'].show_menu()
]:
	i: 3(), 31(), 138(JA), 185(), 232(AE)
	o: 

nname: 232
n 232(None)[]:
	i: 99(f)
	o: 234(AE)

nname: 185
n 185(None)[MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 110(f)
	o: 234()

nname: 138
n 138(None)[BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
]:
	i: 110(t)
	o: 234(JA)

nname: 110
n 110(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
PRINT_EXCEPTION()
]:
	i: 99(t)
	o: 138(t), 185(f)

nname: 99
n 99(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 21(f)
	o: 110(t), 232(f)

nname: 31
n 31(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
]:
	i: 21(t)
	o: 234()

nname: 21
n 21(<dummy_ex3> EXC_MATCH RemoveError)[]:
	i: 0(except)
	o: 31(t), 99(f)

nname: 3
n 3(None)[context['selected'].vfs_delete()
]:
	i: 0(try)
	o: 234()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 21(except)

nname: 21
n 21(None)[except RemoveError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
except:
	except NotPermittedError, e:
		PRINT_EXCEPTION()
		if e.message == 'NOT_SUPPORTED_BY_FS':
			BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
		else:
			MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
marker_list._refresh()
context['selected'].show_menu()
]:
	i: 0()
	o: 

nname: 0
n 0(None)[try:
	context['selected'].vfs_delete()
]:
	i: 
	o: 21()

nname: 0
n 0(None)[try:
	context['selected'].vfs_delete()
except RemoveError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
except:
	except NotPermittedError, e:
		PRINT_EXCEPTION()
		if e.message == 'NOT_SUPPORTED_BY_FS':
			BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
		else:
			MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
marker_list._refresh()
context['selected'].show_menu()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb761690c>}
nname: 110
n 110(None)[]:
	i: 85(), 109()
	o: 

nname: 109
n 109(None)[]:
	i: 0&65(f)
	o: 110()

nname: 85
n 85(None)[context['menu'].contextual_windows.append(win)
]:
	i: 0&65(t)
	o: 110()

nname: 0&65
n 0&65(context['menu'] and hasattr(context['menu'], 'contextual_windows'))[def __do_delete(context, marker_list):
	try:
		context['selected'].vfs_delete()
	except RemoveError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	marker_list._refresh()
	context['selected'].show_menu()

win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete, confirm_args=(context, marker))
win.show()
]:
	i: 
	o: 85(t), 109(f)

nname: 0&65
n 0&65(None)[def __do_delete(context, marker_list):
	try:
		context['selected'].vfs_delete()
	except RemoveError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	marker_list._refresh()
	context['selected'].show_menu()

win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete, confirm_args=(context, marker))
win.show()
if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
	context['menu'].contextual_windows.append(win)
]:
	i: 
	o: 

self.nodes: {'0&65': <unpyclib.structure.node instance at 0xb7609fcc>}
nname: 351
n 351(None)[]:
	i: 56(JA), 135(JA), 288(JA), 347(), 350()
	o: 

nname: 350
n 350(None)[]:
	i: 0(f)
	o: 351()

nname: 347
n 347(None)[]:
	i: 241(JA), 337()
	o: 351()

nname: 337
n 337(None)[kbd.hide()
]:
	i: 19(), 335(AE)
	o: 347()

nname: 335
n 335(None)[]:
	i: 202(f)
	o: 337(AE)

nname: 288
n 288(None)[MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 213(f)
	o: 351(JA)

nname: 241
n 241(None)[BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
]:
	i: 213(t)
	o: 347(JA)

nname: 213
n 213(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
PRINT_EXCEPTION()
]:
	i: 202(t)
	o: 241(t), 288(f)

nname: 202
n 202(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 124(f)
	o: 213(t), 335(f)

nname: 135
n 135(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 124(t)
	o: 351(JA)

nname: 124
n 124(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 46(f)
	o: 135(t), 202(f)

nname: 56
n 56(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
]:
	i: 46(t)
	o: 351(JA)

nname: 46
n 46(<dummy_ex3> EXC_MATCH SetMetadataError)[]:
	i: 15(except)
	o: 56(t), 124(f)

nname: 19
n 19(None)[context['selected'].vfs_rename(new_name.strip())
]:
	i: 15(try)
	o: 337()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 19(try), 46(except)

nname: 0
n 0(new_name)[new_name = kbd._text
]:
	i: 
	o: 15(t), 350(f)

nname: 351
n 351(None)[]:
	i: 56(JA), 135(JA), 288(JA), 241(JA), 337(), 0(f)
	o: 

nname: 337
n 337(None)[kbd.hide()
]:
	i: 19(), 335(AE)
	o: 351()

nname: 335
n 335(None)[]:
	i: 202(f)
	o: 337(AE)

nname: 288
n 288(None)[MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 213(f)
	o: 351(JA)

nname: 241
n 241(None)[BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
]:
	i: 213(t)
	o: 351(JA)

nname: 213
n 213(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
PRINT_EXCEPTION()
]:
	i: 202(t)
	o: 241(t), 288(f)

nname: 202
n 202(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 124(f)
	o: 213(t), 335(f)

nname: 135
n 135(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 124(t)
	o: 351(JA)

nname: 124
n 124(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 46(f)
	o: 135(t), 202(f)

nname: 56
n 56(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
]:
	i: 46(t)
	o: 351(JA)

nname: 46
n 46(<dummy_ex3> EXC_MATCH SetMetadataError)[]:
	i: 15(except)
	o: 56(t), 124(f)

nname: 19
n 19(None)[context['selected'].vfs_rename(new_name.strip())
]:
	i: 15(try)
	o: 337()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 19(try), 46(except)

nname: 0
n 0(new_name)[new_name = kbd._text
]:
	i: 
	o: 15(t), 351(f)

nname: 351
n 351(None)[]:
	i: 56(JA), 135(JA), 213(JA), 337(), 0(f), 202(f)
	o: 

nname: 213
n 213(None)[#, e
PRINT_EXCEPTION()
if e.message == 'NOT_SUPPORTED_BY_FS':
	BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
else:
	MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 202(t)
	o: 351(JA)

nname: 202
n 202(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 124(f)
	o: 213(t), 351(f)

nname: 135
n 135(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 124(t)
	o: 351(JA)

nname: 124
n 124(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 46(f)
	o: 135(t), 202(f)

nname: 56
n 56(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
]:
	i: 46(t)
	o: 351(JA)

nname: 46
n 46(<dummy_ex3> EXC_MATCH SetMetadataError)[]:
	i: 15(except)
	o: 56(t), 124(f)

nname: 337
n 337(None)[kbd.hide()
]:
	i: 19(), 335(AE)
	o: 351()

nname: 19
n 19(None)[context['selected'].vfs_rename(new_name.strip())
]:
	i: 15(try)
	o: 337()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 19(try), 46(except)

nname: 0
n 0(new_name)[new_name = kbd._text
]:
	i: 
	o: 15(t), 351(f)

nname: 351
n 351(None)[]:
	i: 46(), 0(f)
	o: 

nname: 46
n 46(None)[except SetMetadataError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
except:
	except FilenameExistsError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
else:
	kbd.hide()
]:
	i: 15()
	o: 351()

nname: 15
n 15(None)[try:
	context['selected'].vfs_rename(new_name.strip())
]:
	i: 0(t)
	o: 46()

nname: 0
n 0(new_name)[new_name = kbd._text
]:
	i: 
	o: 15(t), 351(f)

nname: 351
n 351(None)[]:
	i: 15(), 0(f)
	o: 

nname: 15
n 15(None)[try:
	context['selected'].vfs_rename(new_name.strip())
except SetMetadataError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
except:
	except FilenameExistsError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
else:
	kbd.hide()
]:
	i: 0(t)
	o: 351()

nname: 0
n 0(new_name)[new_name = kbd._text
]:
	i: 
	o: 15(t), 351(f)

nname: 0
n 0(None)[new_name = kbd._text
if new_name:
	try:
		context['selected'].vfs_rename(new_name.strip())
	except SetMetadataError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
	except:
		except FilenameExistsError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	else:
		kbd.hide()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb761182c>}
nname: 143
n 143(None)[return None
]:
	i: 118(), 142()
	o: 

nname: 142
n 142(None)[]:
	i: 0&98(f)
	o: 143()

nname: 118
n 118(None)[context['menu'].contextual_windows.append(kbd)
]:
	i: 0&98(t)
	o: 143()

nname: 0&98
n 0&98(context['menu'] and hasattr(context['menu'], 'contextual_windows'))[text = None
def __do_rename(kbd):
	new_name = kbd._text
	if new_name:
		try:
			context['selected'].vfs_rename(new_name.strip())
		except SetMetadataError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
		except:
			except FilenameExistsError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
			except:
				except NotPermittedError, e:
					PRINT_EXCEPTION()
					if e.message == 'NOT_SUPPORTED_BY_FS':
						BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
					else:
						MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		else:
			kbd.hide()

text = context['selected'].name
kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
context['selected'].show_menu()
kbd.show()
]:
	i: 
	o: 118(t), 142(f)

nname: 0&98
n 0&98(None)[text = None
def __do_rename(kbd):
	new_name = kbd._text
	if new_name:
		try:
			context['selected'].vfs_rename(new_name.strip())
		except SetMetadataError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
		except:
			except FilenameExistsError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
			except:
				except NotPermittedError, e:
					PRINT_EXCEPTION()
					if e.message == 'NOT_SUPPORTED_BY_FS':
						BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
					else:
						MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		else:
			kbd.hide()

text = context['selected'].name
kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
context['selected'].show_menu()
kbd.show()
if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
	context['menu'].contextual_windows.append(kbd)
return None
]:
	i: 
	o: 

self.nodes: {'0&98': <unpyclib.structure.node instance at 0xb76827ec>}
nname: 84
n 84(None)[editor.show(hide_previous_menu=False)
]:
	i: 49(), 68()
	o: 

nname: 68
n 68(None)[editor = PlaylistEditor(playlist=selected)
]:
	i: 0(f)
	o: 84()

nname: 49
n 49(None)[editor = FavoriteEditor(playlist=selected)
]:
	i: 0(t)
	o: 84()

nname: 0
n 0(context['menu'].universe == 'tv')[selected = context['selected']
pygui_globs['menustack'].back_to_menu(selected.menu)
]:
	i: 
	o: 49(t), 68(f)

nname: 0
n 0(None)[selected = context['selected']
pygui_globs['menustack'].back_to_menu(selected.menu)
if context['menu'].universe == 'tv':
	editor = FavoriteEditor(playlist=selected)
else:
	editor = PlaylistEditor(playlist=selected)
editor.show(hide_previous_menu=False)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7609e8c>}
nname: 350
n 350(None)[]:
	i: 56(JA), 134(JA), 287(JA), 346(), 349()
	o: 

nname: 349
n 349(None)[]:
	i: 0(f)
	o: 350()

nname: 346
n 346(None)[]:
	i: 240(JA), 336()
	o: 350()

nname: 336
n 336(None)[kbd.hide()
]:
	i: 19(), 334(AE)
	o: 346()

nname: 334
n 334(None)[]:
	i: 201(f)
	o: 336(AE)

nname: 287
n 287(None)[MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 212(f)
	o: 350(JA)

nname: 240
n 240(None)[BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
]:
	i: 212(t)
	o: 346(JA)

nname: 212
n 212(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
PRINT_EXCEPTION()
]:
	i: 201(t)
	o: 240(t), 287(f)

nname: 201
n 201(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 123(f)
	o: 212(t), 334(f)

nname: 134
n 134(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 123(t)
	o: 350(JA)

nname: 123
n 123(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 46(f)
	o: 134(t), 201(f)

nname: 56
n 56(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 46(t)
	o: 350(JA)

nname: 46
n 46(<dummy_ex3> EXC_MATCH CreateContainerError)[]:
	i: 15(except)
	o: 56(t), 123(f)

nname: 19
n 19(None)[context['parent'].vfs_mkdir(name.strip())
]:
	i: 15(try)
	o: 336()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 19(try), 46(except)

nname: 0
n 0(name)[name = kbd._text
]:
	i: 
	o: 15(t), 349(f)

nname: 350
n 350(None)[]:
	i: 56(JA), 134(JA), 287(JA), 240(JA), 336(), 0(f)
	o: 

nname: 336
n 336(None)[kbd.hide()
]:
	i: 19(), 334(AE)
	o: 350()

nname: 334
n 334(None)[]:
	i: 201(f)
	o: 336(AE)

nname: 287
n 287(None)[MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 212(f)
	o: 350(JA)

nname: 240
n 240(None)[BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
]:
	i: 212(t)
	o: 350(JA)

nname: 212
n 212(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
PRINT_EXCEPTION()
]:
	i: 201(t)
	o: 240(t), 287(f)

nname: 201
n 201(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 123(f)
	o: 212(t), 334(f)

nname: 134
n 134(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 123(t)
	o: 350(JA)

nname: 123
n 123(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 46(f)
	o: 134(t), 201(f)

nname: 56
n 56(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 46(t)
	o: 350(JA)

nname: 46
n 46(<dummy_ex3> EXC_MATCH CreateContainerError)[]:
	i: 15(except)
	o: 56(t), 123(f)

nname: 19
n 19(None)[context['parent'].vfs_mkdir(name.strip())
]:
	i: 15(try)
	o: 336()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 19(try), 46(except)

nname: 0
n 0(name)[name = kbd._text
]:
	i: 
	o: 15(t), 350(f)

nname: 350
n 350(None)[]:
	i: 56(JA), 134(JA), 212(JA), 336(), 0(f), 201(f)
	o: 

nname: 212
n 212(None)[#, e
PRINT_EXCEPTION()
if e.message == 'NOT_SUPPORTED_BY_FS':
	BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
else:
	MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 201(t)
	o: 350(JA)

nname: 201
n 201(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 123(f)
	o: 212(t), 350(f)

nname: 134
n 134(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 123(t)
	o: 350(JA)

nname: 123
n 123(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 46(f)
	o: 134(t), 201(f)

nname: 56
n 56(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
]:
	i: 46(t)
	o: 350(JA)

nname: 46
n 46(<dummy_ex3> EXC_MATCH CreateContainerError)[]:
	i: 15(except)
	o: 56(t), 123(f)

nname: 336
n 336(None)[kbd.hide()
]:
	i: 19(), 334(AE)
	o: 350()

nname: 19
n 19(None)[context['parent'].vfs_mkdir(name.strip())
]:
	i: 15(try)
	o: 336()

nname: 15
n 15(None)[]:
	i: 0(t)
	o: 19(try), 46(except)

nname: 0
n 0(name)[name = kbd._text
]:
	i: 
	o: 15(t), 350(f)

nname: 350
n 350(None)[]:
	i: 46(), 0(f)
	o: 

nname: 46
n 46(None)[except CreateContainerError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
except:
	except FilenameExistsError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
else:
	kbd.hide()
]:
	i: 15()
	o: 350()

nname: 15
n 15(None)[try:
	context['parent'].vfs_mkdir(name.strip())
]:
	i: 0(t)
	o: 46()

nname: 0
n 0(name)[name = kbd._text
]:
	i: 
	o: 15(t), 350(f)

nname: 350
n 350(None)[]:
	i: 15(), 0(f)
	o: 

nname: 15
n 15(None)[try:
	context['parent'].vfs_mkdir(name.strip())
except CreateContainerError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
except:
	except FilenameExistsError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
else:
	kbd.hide()
]:
	i: 0(t)
	o: 350()

nname: 0
n 0(name)[name = kbd._text
]:
	i: 
	o: 15(t), 350(f)

nname: 0
n 0(None)[name = kbd._text
if name:
	try:
		context['parent'].vfs_mkdir(name.strip())
	except CreateContainerError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
	except:
		except FilenameExistsError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	else:
		kbd.hide()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb761fecc>}
nname: 149
n 149(None)[]:
	i: 124(), 148()
	o: 

nname: 148
n 148(None)[]:
	i: 0&104(f)
	o: 149()

nname: 124
n 124(None)[context['menu'].contextual_windows.append(kbd)
]:
	i: 0&104(t)
	o: 149()

nname: 0&104
n 0&104(context['menu'] and hasattr(context['menu'], 'contextual_windows'))[def __do_mkdir(kbd):
	name = kbd._text
	if name:
		try:
			context['parent'].vfs_mkdir(name.strip())
		except CreateContainerError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
		except:
			except FilenameExistsError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
			except:
				except NotPermittedError, e:
					PRINT_EXCEPTION()
					if e.message == 'NOT_SUPPORTED_BY_FS':
						BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
					else:
						MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		else:
			kbd.hide()

name = context['parent'].get_free_child_name(_('New folder'))
kbd = KeyboardWindow(_('Folder name'), text=name, confirm_action=__do_mkdir)
context['parent'].show_menu()
kbd.show()
]:
	i: 
	o: 124(t), 148(f)

nname: 0&104
n 0&104(None)[def __do_mkdir(kbd):
	name = kbd._text
	if name:
		try:
			context['parent'].vfs_mkdir(name.strip())
		except CreateContainerError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
		except:
			except FilenameExistsError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
			except:
				except NotPermittedError, e:
					PRINT_EXCEPTION()
					if e.message == 'NOT_SUPPORTED_BY_FS':
						BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
					else:
						MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		else:
			kbd.hide()

name = context['parent'].get_free_child_name(_('New folder'))
kbd = KeyboardWindow(_('Folder name'), text=name, confirm_action=__do_mkdir)
context['parent'].show_menu()
kbd.show()
if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
	context['menu'].contextual_windows.append(kbd)
]:
	i: 
	o: 

self.nodes: {'0&104': <unpyclib.structure.node instance at 0xb7682dac>}
nname: 144
n 144(None)[self._win.set_cancel(self.cancel)
self._win.show()
return None
]:
	i: 97(), 125()
	o: 

nname: 125
n 125(None)[self._win = ProgressWindow(self._title)
]:
	i: 29(f)
	o: 144()

nname: 97
n 97(None)[self._win = win
self._win.title = self._title
]:
	i: 29(t)
	o: 144()

nname: 29
n 29(win)[ThreadedTask.__init__(self, job)
self._title = title
self._context = context
self._context.show_menu()
self._context.menu.hold = True
]:
	i: 12(), 28()
	o: 97(t), 125(f)

nname: 28
n 28(None)[]:
	i: 0(f)
	o: 29()

nname: 12
n 12(None)[title = _('Please wait...')
]:
	i: 0(t)
	o: 29()

nname: 0
n 0(title is None)[]:
	i: 
	o: 12(t), 28(f)

nname: 144
n 144(None)[self._win.set_cancel(self.cancel)
self._win.show()
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if title is None:
	title = _('Please wait...')
ThreadedTask.__init__(self, job)
self._title = title
self._context = context
self._context.show_menu()
self._context.menu.hold = True
if win:
	self._win = win
	self._win.title = self._title
else:
	self._win = ProgressWindow(self._title)
]:
	i: 
	o: 144()

nname: 0
n 0(None)[if title is None:
	title = _('Please wait...')
ThreadedTask.__init__(self, job)
self._title = title
self._context = context
self._context.show_menu()
self._context.menu.hold = True
if win:
	self._win = win
	self._win.title = self._title
else:
	self._win = ProgressWindow(self._title)
self._win.set_cancel(self.cancel)
self._win.show()
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76828ac>}
nname: 182
n 182(None)[return None
]:
	i: 155(), 168(), 181(AE)
	o: 

nname: 168
n 168(None)[PRINT_EXCEPTION()
]:
	i: 0(except)
	o: 182()

nname: 155
n 155(None)[pw.progress = percent
]:
	i: 46(JA), 87(AL), 150(), 154()
	o: 182()

nname: 154
n 154(None)[]:
	i: 3(f)
	o: 155()

nname: 150
n 150(None)[]:
	i: 109(AF), 122()
	o: 155()

nname: 122
n 122(None)[for k, v in infos_dict.items():
setattr(pw, k, v)
]:
	i: 109(for)
	o: 150()

nname: 109
n 109(None)[]:
	i: 87(loop)
	o: 122(for), 150(AF)

nname: 87
n 87(None)[percent = infos_dict.pop('percent', 100.0)
]:
	i: 30(f)
	o: 109(loop), 155(AL)

nname: 46
n 46(None)[BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
]:
	i: 30(t)
	o: 155(JA)

nname: 30
n 30(isinstance(infos_dict, basestring))[]:
	i: 3(t)
	o: 46(t), 87(f)

nname: 3
n 3(infos_dict is not None)[pw = self._win
percent = 0.0
]:
	i: 0(try)
	o: 30(t), 154(f)

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 168(except)

nname: 182
n 182(None)[return None
]:
	i: 155(), 168()
	o: 

nname: 168
n 168(None)[except:
	PRINT_EXCEPTION()
]:
	i: 0()
	o: 182()

nname: 155
n 155(None)[pw.progress = percent
]:
	i: 46(JA), 122(), 0(f)
	o: 182()

nname: 122
n 122(None)[for k, v in infos_dict.items():
	setattr(pw, k, v)
]:
	i: 87(for)
	o: 155()

nname: 87
n 87(None)[percent = infos_dict.pop('percent', 100.0)
]:
	i: 30(f)
	o: 122(for)

nname: 46
n 46(None)[BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
]:
	i: 30(t)
	o: 155(JA)

nname: 30
n 30(isinstance(infos_dict, basestring))[]:
	i: 0(t)
	o: 46(t), 87(f)

nname: 0
n 0(infos_dict is not None)[try:
	pw = self._win
	percent = 0.0
]:
	i: 
	o: 30(t), 155(f), 168()

nname: 182
n 182(None)[return None
]:
	i: 155(), 168()
	o: 

nname: 168
n 168(None)[except:
	PRINT_EXCEPTION()
]:
	i: 0()
	o: 182()

nname: 155
n 155(None)[pw.progress = percent
]:
	i: 46(JA), 87(), 0(f)
	o: 182()

nname: 87
n 87(None)[percent = infos_dict.pop('percent', 100.0)
for k, v in infos_dict.items():
	setattr(pw, k, v)
]:
	i: 30(f)
	o: 155()

nname: 46
n 46(None)[BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
]:
	i: 30(t)
	o: 155(JA)

nname: 30
n 30(isinstance(infos_dict, basestring))[]:
	i: 0(t)
	o: 46(t), 87(f)

nname: 0
n 0(infos_dict is not None)[try:
	pw = self._win
	percent = 0.0
]:
	i: 
	o: 30(t), 155(f), 168()

nname: 182
n 182(None)[return None
]:
	i: 0(), 168()
	o: 

nname: 0
n 0(None)[try:
	pw = self._win
	percent = 0.0
if infos_dict is not None:
	if isinstance(infos_dict, basestring):
		BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
	else:
		percent = infos_dict.pop('percent', 100.0)
		for k, v in infos_dict.items():
			setattr(pw, k, v)
pw.progress = percent
]:
	i: 
	o: 182()

self.nodes: {0: <unpyclib.structure.node instance at 0xb768294c>, 182: <unpyclib.structure.node instance at 0xb768204c>, 168: <unpyclib.structure.node instance at 0xb7682c4c>}
nname: 0
n 0(None)[return pygui_globs['menustack'].back_to_home()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7616f4c>}
nname: 0
n 0(None)[return pygui_globs['menustack'].back_to_home()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7616fcc>}
nname: 200
n 200(None)[context.menu.hold = False
self._win.hide()
return None
]:
	i: 182(), 186(), 199(AE)
	o: 

nname: 186
n 186(None)[PRINT_EXCEPTION()
]:
	i: 61(except)
	o: 200()

nname: 182
n 182(None)[]:
	i: 142(), 181()
	o: 200()

nname: 181
n 181(None)[]:
	i: 86&123(f)
	o: 182()

nname: 142
n 142(None)[log.debug('hack for standby: go home')
Task((lambda : pygui_globs['menustack'].back_to_home())).start(1)
]:
	i: 86&123(t)
	o: 182()

nname: 86&123
n 86&123(context.menu.hold and power_mgr.pm.apm_state > 0)[from pygui.facilities.power import PowerManager
power_mgr = PowerManager()
]:
	i: 61(try)
	o: 142(t), 181(f)

nname: 61
n 61(None)[log.debug('context.menu.hold=%s', context.menu.hold)
]:
	i: 40(), 60()
	o: 86&123(try), 186(except)

nname: 60
n 60(None)[]:
	i: 0(f)
	o: 61()

nname: 40
n 40(None)[context.menu.select(0)
]:
	i: 0(t)
	o: 61()

nname: 0
n 0(context.menu.selected == None)[context = self._context
context.menu.reload_func()
]:
	i: 
	o: 40(t), 60(f)

nname: 200
n 200(None)[context.menu.hold = False
self._win.hide()
return None
]:
	i: 186(), 86&123()
	o: 

nname: 186
n 186(None)[except:
	PRINT_EXCEPTION()
]:
	i: 86&123()
	o: 200()

nname: 200
n 200(None)[context.menu.hold = False
self._win.hide()
return None
]:
	i: 186(), 86&123()
	o: 

nname: 86&123
n 86&123(None)[try:
	from pygui.facilities.power import PowerManager
	power_mgr = PowerManager()
	if context.menu.hold and power_mgr.pm.apm_state > 0:
		log.debug('hack for standby: go home')
		Task((lambda : pygui_globs['menustack'].back_to_home())).start(1)
]:
	i: 0(try)
	o: 200(), 186()

nname: 0
n 0(None)[context = self._context
context.menu.reload_func()
if context.menu.selected == None:
	context.menu.select(0)
log.debug('context.menu.hold=%s', context.menu.hold)
]:
	i: 
	o: 86&123(try)

nname: 200
n 200(None)[context.menu.hold = False
self._win.hide()
return None
]:
	i: 186(), 0()
	o: 

nname: 186
n 186(None)[except:
	PRINT_EXCEPTION()
]:
	i: 0()
	o: 200()

nname: 200
n 200(None)[context.menu.hold = False
self._win.hide()
return None
]:
	i: 186(), 0()
	o: 

nname: 0
n 0(None)[context = self._context
context.menu.reload_func()
if context.menu.selected == None:
	context.menu.select(0)
log.debug('context.menu.hold=%s', context.menu.hold)
try:
	from pygui.facilities.power import PowerManager
	power_mgr = PowerManager()
	if context.menu.hold and power_mgr.pm.apm_state > 0:
		log.debug('hack for standby: go home')
		Task((lambda : pygui_globs['menustack'].back_to_home())).start(1)
]:
	i: 
	o: 200(), 186()

self.nodes: {0: <unpyclib.structure.node instance at 0xb7616b0c>, 200: <unpyclib.structure.node instance at 0xb768276c>, 186: <unpyclib.structure.node instance at 0xb76821cc>}
nname: 6
n 6(None)[__doc__ = '\n    Launch a thread job and report its state on a ProgressWindow\n    '
def __init__(self, job, context, title=None, win=None, *args, **args):
	if title is None:
		title = _('Please wait...')
	ThreadedTask.__init__(self, job)
	self._title = title
	self._context = context
	self._context.show_menu()
	self._context.menu.hold = True
	if win:
		self._win = win
		self._win.title = self._title
	else:
		self._win = ProgressWindow(self._title)
	self._win.set_cancel(self.cancel)
	self._win.show()
	return None

def report_job_progress(self, infos_dict):
	try:
		pw = self._win
		percent = 0.0
	if infos_dict is not None:
		if isinstance(infos_dict, basestring):
			BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
		else:
			percent = infos_dict.pop('percent', 100.0)
			for k, v in infos_dict.items():
				setattr(pw, k, v)
	pw.progress = percent

def on_terminate(self):
	context = self._context
	context.menu.reload_func()
	if context.menu.selected == None:
		context.menu.select(0)
	log.debug('context.menu.hold=%s', context.menu.hold)
	try:
		from pygui.facilities.power import PowerManager
		power_mgr = PowerManager()
		if context.menu.hold and power_mgr.pm.apm_state > 0:
			log.debug('hack for standby: go home')
			Task((lambda : pygui_globs['menustack'].back_to_home())).start(1)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7609ccc>}
nname: 0
n 0(None)[HookThread.__init__(self)
self._marker = marker
self._context = context
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76165ec>}
nname: 0
n 0(None)[marker = self._marker
marker.vfs_copy_to(self._context)
self.started.set()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76166ac>}
nname: 294
n 294(None)[return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)
]:
	i: 268(t), 290()
	o: 

nname: 290
n 290(None)[]:
	i: 268(f)
	o: 294()

nname: 268
n 268(tot_size)[rem = 'N/A'
]:
	i: 251(), 264()
	o: 290(f), 294(t)

nname: 264
n 264(None)[]:
	i: 208(f)
	o: 268()

nname: 251
n 251(None)[]:
	i: 208(t)
	o: 268()

nname: 208
n 208(rem >= 0)[tot_nb, tot_size, copied_nb, copied_size, current = status
rem = tot_size - copied_size
]:
	i: 186(), 207()
	o: 251(t), 264(f)

nname: 207
n 207(None)[]:
	i: 174(f)
	o: 208()

nname: 186
n 186(None)[self.completed.set()
return None
]:
	i: 174(t)
	o: 208()

nname: 174
n 174(status is None)[]:
	i: 16(), 67(), 95(), 144(JA), 158(), 172(AE)
	o: 186(t), 207(f)

nname: 172
n 172(None)[]:
	i: 112(f)
	o: 174(AE)

nname: 158
n 158(None)[return _('Operation not permitted')
]:
	i: 123(f)
	o: 174()

nname: 144
n 144(None)[return _('The way this disk was formatted does not allow this operation')
]:
	i: 123(t)
	o: 174(JA)

nname: 123
n 123(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
]:
	i: 112(t)
	o: 144(t), 158(f)

nname: 112
n 112(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 84(f)
	o: 123(t), 172(f)

nname: 95
n 95(None)[return _('Error while copying files: disk full')
]:
	i: 84(t)
	o: 174()

nname: 84
n 84(<dummy_ex3> EXC_MATCH DiskFullError)[]:
	i: 51(f)
	o: 95(t), 112(f)

nname: 67
n 67(None)[return _('Error while copying files')
]:
	i: 51(t)
	o: 174()

nname: 51
n 51(<dummy_ex3> EXC_MATCH (CopyError, IOError))[]:
	i: 0(except)
	o: 67(t), 84(f)

nname: 16
n 16(None)[status = self._marker.vfs_copy_status()
log.debug('status: %s', status)
]:
	i: 0(try)
	o: 174()

nname: 0
n 0(None)[self.started.wait()
]:
	i: 
	o: 16(try), 51(except)

nname: 294
n 294(None)[return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)
]:
	i: 208(t)
	o: 

nname: 208
n 208(None)[tot_nb, tot_size, copied_nb, copied_size, current = status
rem = tot_size - copied_size
if rem >= 0:
	pass
rem = 'N/A'
if not tot_size:
	pass
]:
	i: 51()
	o: 294()

nname: 51
n 51(None)[except (CopyError, IOError):
	return _('Error while copying files')
except:
	except DiskFullError:
		return _('Error while copying files: disk full')
	except:
		except NotPermittedError, e:
			if e.message == 'NOT_SUPPORTED_BY_FS':
				return _('The way this disk was formatted does not allow this operation')
			else:
				return _('Operation not permitted')
if status is None:
	self.completed.set()
	return None
]:
	i: 0()
	o: 208()

nname: 0
n 0(None)[self.started.wait()
try:
	status = self._marker.vfs_copy_status()
	log.debug('status: %s', status)
]:
	i: 
	o: 51()

nname: 208
n 208(None)[tot_nb, tot_size, copied_nb, copied_size, current = status
rem = tot_size - copied_size
if rem >= 0:
	pass
rem = 'N/A'
if not tot_size:
	pass
return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)
]:
	i: 0()
	o: 

nname: 0
n 0(None)[self.started.wait()
try:
	status = self._marker.vfs_copy_status()
	log.debug('status: %s', status)
except (CopyError, IOError):
	return _('Error while copying files')
except:
	except DiskFullError:
		return _('Error while copying files: disk full')
	except:
		except NotPermittedError, e:
			if e.message == 'NOT_SUPPORTED_BY_FS':
				return _('The way this disk was formatted does not allow this operation')
			else:
				return _('Operation not permitted')
if status is None:
	self.completed.set()
	return None
]:
	i: 
	o: 208()

nname: 0
n 0(None)[self.started.wait()
try:
	status = self._marker.vfs_copy_status()
	log.debug('status: %s', status)
except (CopyError, IOError):
	return _('Error while copying files')
except:
	except DiskFullError:
		return _('Error while copying files: disk full')
	except:
		except NotPermittedError, e:
			if e.message == 'NOT_SUPPORTED_BY_FS':
				return _('The way this disk was formatted does not allow this operation')
			else:
				return _('Operation not permitted')
if status is None:
	self.completed.set()
	return None
tot_nb, tot_size, copied_nb, copied_size, current = status
rem = tot_size - copied_size
if rem >= 0:
	pass
rem = 'N/A'
if not tot_size:
	pass
return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7682b2c>}
nname: 0
n 0(None)[self._marker.vfs_copy_cancel()
HookThread.on_cancel(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb761626c>}
nname: 6
n 6(None)[__doc__ = 'Process the copy of items via wymedia calls'
def __init__(self, marker, context):
	HookThread.__init__(self)
	self._marker = marker
	self._context = context

def func_process(self):
	marker = self._marker
	marker.vfs_copy_to(self._context)
	self.started.set()

def get_infos(self):
	self.started.wait()
	try:
		status = self._marker.vfs_copy_status()
		log.debug('status: %s', status)
	except (CopyError, IOError):
		return _('Error while copying files')
	except:
		except DiskFullError:
			return _('Error while copying files: disk full')
		except:
			except NotPermittedError, e:
				if e.message == 'NOT_SUPPORTED_BY_FS':
					return _('The way this disk was formatted does not allow this operation')
				else:
					return _('Operation not permitted')
	if status is None:
		self.completed.set()
		return None
	tot_nb, tot_size, copied_nb, copied_size, current = status
	rem = tot_size - copied_size
	if rem >= 0:
		pass
	rem = 'N/A'
	if not tot_size:
		pass
	return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)

def on_cancel(self):
	self._marker.vfs_copy_cancel()
	HookThread.on_cancel(self)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7609bac>}
nname: 0
n 0(None)[from __future__ import absolute_import
import time
from peewee.formatters import bytes_to_human
from peewee.notifier import Task, ThreadedTask, HookThread
from peewee.debug import PRINT_EXCEPTION, GET_LOGGER
from pygui.shared import pygui_globs
from pygui.menu.menu import FavoriteEditor, PlaylistEditor
from pygui.window import MessageWindow, BigMessageWindow, KeyboardWindow, ProgressWindow, ConfirmWindow
from pygui.markerlist import get_marker_from_item
from wymedia.wmplus import CopyError, RemoveError, SetMetadataError, CreateContainerError, NotPermittedError, FilenameExistsError, DiskFullError
log = GET_LOGGER(__name__)
def execute_eject():
	bus = pygui_globs['wydbus']
	try:
		name = 'com.wyplay.wydetect'
		path = '/com/wyplay/wydetect_status'
		burn_clt = bus.reference(name, path)
		burn_clt_eject = burn_clt.method('toggle_tray', 's', '')
		burn_clt_eject('/dev/cdrom')
	except Exception, e:
		print 'Cannot load wydetect',
		print str(e)
	except:
		print 'Cannot load wydetect.'

def execute_delete(context, marker):
	def __do_delete(context, marker_list):
		try:
			context['selected'].vfs_delete()
		except RemoveError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		marker_list._refresh()
		context['selected'].show_menu()

	win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete, confirm_args=(context, marker))
	win.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(win)

def execute_rename(context):
	text = None
	def __do_rename(kbd):
		new_name = kbd._text
		if new_name:
			try:
				context['selected'].vfs_rename(new_name.strip())
			except SetMetadataError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
			except:
				except FilenameExistsError:
					PRINT_EXCEPTION()
					MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
				except:
					except NotPermittedError, e:
						PRINT_EXCEPTION()
						if e.message == 'NOT_SUPPORTED_BY_FS':
							BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
						else:
							MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
			else:
				kbd.hide()

	text = context['selected'].name
	kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
	context['selected'].show_menu()
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)
	return None

def execute_reorder(context):
	selected = context['selected']
	pygui_globs['menustack'].back_to_menu(selected.menu)
	if context['menu'].universe == 'tv':
		editor = FavoriteEditor(playlist=selected)
	else:
		editor = PlaylistEditor(playlist=selected)
	editor.show(hide_previous_menu=False)

def execute_mkdir(context):
	def __do_mkdir(kbd):
		name = kbd._text
		if name:
			try:
				context['parent'].vfs_mkdir(name.strip())
			except CreateContainerError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
			except:
				except FilenameExistsError:
					PRINT_EXCEPTION()
					MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
				except:
					except NotPermittedError, e:
						PRINT_EXCEPTION()
						if e.message == 'NOT_SUPPORTED_BY_FS':
							BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
						else:
							MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
			else:
				kbd.hide()

	name = context['parent'].get_free_child_name(_('New folder'))
	kbd = KeyboardWindow(_('Folder name'), text=name, confirm_action=__do_mkdir)
	context['parent'].show_menu()
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)

class GraphicalProgress(ThreadedTask):
	__doc__ = '\n    Launch a thread job and report its state on a ProgressWindow\n    '
	def __init__(self, job, context, title=None, win=None, *args, **args):
		if title is None:
			title = _('Please wait...')
		ThreadedTask.__init__(self, job)
		self._title = title
		self._context = context
		self._context.show_menu()
		self._context.menu.hold = True
		if win:
			self._win = win
			self._win.title = self._title
		else:
			self._win = ProgressWindow(self._title)
		self._win.set_cancel(self.cancel)
		self._win.show()
		return None

	def report_job_progress(self, infos_dict):
		try:
			pw = self._win
			percent = 0.0
		if infos_dict is not None:
			if isinstance(infos_dict, basestring):
				BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
			else:
				percent = infos_dict.pop('percent', 100.0)
				for k, v in infos_dict.items():
					setattr(pw, k, v)
		pw.progress = percent

	def on_terminate(self):
		context = self._context
		context.menu.reload_func()
		if context.menu.selected == None:
			context.menu.select(0)
		log.debug('context.menu.hold=%s', context.menu.hold)
		try:
			from pygui.facilities.power import PowerManager
			power_mgr = PowerManager()
			if context.menu.hold and power_mgr.pm.apm_state > 0:
				log.debug('hack for standby: go home')
				Task((lambda : pygui_globs['menustack'].back_to_home())).start(1)



class CopyThread(HookThread):
	__doc__ = 'Process the copy of items via wymedia calls'
	def __init__(self, marker, context):
		HookThread.__init__(self)
		self._marker = marker
		self._context = context

	def func_process(self):
		marker = self._marker
		marker.vfs_copy_to(self._context)
		self.started.set()

	def get_infos(self):
		self.started.wait()
		try:
			status = self._marker.vfs_copy_status()
			log.debug('status: %s', status)
		except (CopyError, IOError):
			return _('Error while copying files')
		except:
			except DiskFullError:
				return _('Error while copying files: disk full')
			except:
				except NotPermittedError, e:
					if e.message == 'NOT_SUPPORTED_BY_FS':
						return _('The way this disk was formatted does not allow this operation')
					else:
						return _('Operation not permitted')
		if status is None:
			self.completed.set()
			return None
		tot_nb, tot_size, copied_nb, copied_size, current = status
		rem = tot_size - copied_size
		if rem >= 0:
			pass
		rem = 'N/A'
		if not tot_size:
			pass
		return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)

	def on_cancel(self):
		self._marker.vfs_copy_cancel()
		HookThread.on_cancel(self)



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb767e74c>}
from __future__ import absolute_import
import time
from peewee.formatters import bytes_to_human
from peewee.notifier import Task, ThreadedTask, HookThread
from peewee.debug import PRINT_EXCEPTION, GET_LOGGER
from pygui.shared import pygui_globs
from pygui.menu.menu import FavoriteEditor, PlaylistEditor
from pygui.window import MessageWindow, BigMessageWindow, KeyboardWindow, ProgressWindow, ConfirmWindow
from pygui.markerlist import get_marker_from_item
from wymedia.wmplus import CopyError, RemoveError, SetMetadataError, CreateContainerError, NotPermittedError, FilenameExistsError, DiskFullError
log = GET_LOGGER(__name__)
def execute_eject():
	bus = pygui_globs['wydbus']
	try:
		name = 'com.wyplay.wydetect'
		path = '/com/wyplay/wydetect_status'
		burn_clt = bus.reference(name, path)
		burn_clt_eject = burn_clt.method('toggle_tray', 's', '')
		burn_clt_eject('/dev/cdrom')
	except Exception, e:
		print 'Cannot load wydetect',
		print str(e)
	except:
		print 'Cannot load wydetect.'

def execute_delete(context, marker):
	def __do_delete(context, marker_list):
		try:
			context['selected'].vfs_delete()
		except RemoveError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error removing %s') % context['selected'].name, title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		marker_list._refresh()
		context['selected'].show_menu()

	win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete, confirm_args=(context, marker))
	win.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(win)

def execute_rename(context):
	text = None
	def __do_rename(kbd):
		new_name = kbd._text
		if new_name:
			try:
				context['selected'].vfs_rename(new_name.strip())
			except SetMetadataError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Error renaming %s') % context['selected'].name, title=_('Error')).show(timeout=5)
			except:
				except FilenameExistsError:
					PRINT_EXCEPTION()
					MessageWindow(text=_('Filename %s already exists') % new_name.strip(), title=_('Error')).show(timeout=5)
				except:
					except NotPermittedError, e:
						PRINT_EXCEPTION()
						if e.message == 'NOT_SUPPORTED_BY_FS':
							BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
						else:
							MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
			else:
				kbd.hide()

	text = context['selected'].name
	kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
	context['selected'].show_menu()
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)
	return None

def execute_reorder(context):
	selected = context['selected']
	pygui_globs['menustack'].back_to_menu(selected.menu)
	if context['menu'].universe == 'tv':
		editor = FavoriteEditor(playlist=selected)
	else:
		editor = PlaylistEditor(playlist=selected)
	editor.show(hide_previous_menu=False)

def execute_mkdir(context):
	def __do_mkdir(kbd):
		name = kbd._text
		if name:
			try:
				context['parent'].vfs_mkdir(name.strip())
			except CreateContainerError:
				PRINT_EXCEPTION()
				MessageWindow(text=_('Error creating %s') % name.strip(), title=_('Error')).show(timeout=5)
			except:
				except FilenameExistsError:
					PRINT_EXCEPTION()
					MessageWindow(text=_('Filename %s already exists') % name.strip(), title=_('Error')).show(timeout=5)
				except:
					except NotPermittedError, e:
						PRINT_EXCEPTION()
						if e.message == 'NOT_SUPPORTED_BY_FS':
							BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
						else:
							MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
			else:
				kbd.hide()

	name = context['parent'].get_free_child_name(_('New folder'))
	kbd = KeyboardWindow(_('Folder name'), text=name, confirm_action=__do_mkdir)
	context['parent'].show_menu()
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)

class GraphicalProgress(ThreadedTask):
	__doc__ = '\n    Launch a thread job and report its state on a ProgressWindow\n    '
	def __init__(self, job, context, title=None, win=None, *args, **args):
		if title is None:
			title = _('Please wait...')
		ThreadedTask.__init__(self, job)
		self._title = title
		self._context = context
		self._context.show_menu()
		self._context.menu.hold = True
		if win:
			self._win = win
			self._win.title = self._title
		else:
			self._win = ProgressWindow(self._title)
		self._win.set_cancel(self.cancel)
		self._win.show()
		return None

	def report_job_progress(self, infos_dict):
		try:
			pw = self._win
			percent = 0.0
		if infos_dict is not None:
			if isinstance(infos_dict, basestring):
				BigMessageWindow(text=infos_dict, title=_('Error')).show(timeout=5)
			else:
				percent = infos_dict.pop('percent', 100.0)
				for k, v in infos_dict.items():
					setattr(pw, k, v)
		pw.progress = percent

	def on_terminate(self):
		context = self._context
		context.menu.reload_func()
		if context.menu.selected == None:
			context.menu.select(0)
		log.debug('context.menu.hold=%s', context.menu.hold)
		try:
			from pygui.facilities.power import PowerManager
			power_mgr = PowerManager()
			if context.menu.hold and power_mgr.pm.apm_state > 0:
				log.debug('hack for standby: go home')
				Task((lambda : pygui_globs['menustack'].back_to_home())).start(1)



class CopyThread(HookThread):
	__doc__ = 'Process the copy of items via wymedia calls'
	def __init__(self, marker, context):
		HookThread.__init__(self)
		self._marker = marker
		self._context = context

	def func_process(self):
		marker = self._marker
		marker.vfs_copy_to(self._context)
		self.started.set()

	def get_infos(self):
		self.started.wait()
		try:
			status = self._marker.vfs_copy_status()
			log.debug('status: %s', status)
		except (CopyError, IOError):
			return _('Error while copying files')
		except:
			except DiskFullError:
				return _('Error while copying files: disk full')
			except:
				except NotPermittedError, e:
					if e.message == 'NOT_SUPPORTED_BY_FS':
						return _('The way this disk was formatted does not allow this operation')
					else:
						return _('Operation not permitted')
		if status is None:
			self.completed.set()
			return None
		tot_nb, tot_size, copied_nb, copied_size, current = status
		rem = tot_size - copied_size
		if rem >= 0:
			pass
		rem = 'N/A'
		if not tot_size:
			pass
		return dict(percent=copied_size * 100.0 / tot_size, description=current, total=bytes_to_human(tot_size), elapsed=bytes_to_human(copied_size), remaining=rem)

	def on_cancel(self):
		self._marker.vfs_copy_cancel()
		HookThread.on_cancel(self)



